<template>
  <div>
    <h1>我是day03组件</h1>
    <button @click="btn()">提供自定义事件</button>
    <h1>{{ userName }}</h1>
    <h1>{{ age }}</h1>
  </div>
</template>

<script>
export default {
    name:"MyDay03",
    props:["age"],
    data() {
        return {
            userName:"张三",
            // age:"小红"
            ids:99,
            str:"我是自定义事件点击"
        }
    },
    methods:{
        btn(){
            this.$emit("wq",this.userName)
            this.$emit("zpj",this.ids)
            this.$emit("click")
        }
    },
    // created(){
    //     this.$emit("wq",this.userName)
    // }
}
</script>

<style>

</style>